function isType(type: string) {
  return function (e: any) {
    return Object.prototype.toString.call(e) === `[object ${type}]`
  }
}

export const isArray = isType('Array')

export const isObject = isType('Object')

export const isBoolean = isType('Boolean')

export const isNumber = isType('Number')

export const isString = isType('String')

export const isDate = isType('Date')

export const isFunction = isType('Function')

export const isNull = isType('Null')

export const isUndefined = isType('Undefined')

export default {
  isArray,
  isObject,
  isBoolean,
  isNumber,
  isString,
  isDate,
  isFunction,
  isNull,
  isUndefined
}
